<template>
	<view>
		<cu-custom :bgColor="userType=='20'?'bg-gradual-blue-light':'bg-gradual-orange-light'" title="发现"></cu-custom>
		<view class="cu-list menu sm-border bg-white"  >
			<view class="cu-item arrow" >
				<view class="content"  @tap="menuTap({ linkType:'router',linkName:'help'})">
					<text class="iconfont icon-pengyouquan text-blue"></text>
					<text >圈子</text>
				</view>
			</view>
		</view>
		<!--
		<view class="cu-list menu sm-border bg-white margin-top-sm"  >
			<view class="cu-item arrow" >
				<view class="content"  @tap="menuTap({ linkType:'router',linkName:'videoList'})">
					<text class="iconfont icon-shipin text-blue"></text>
					<text >视频</text>
				</view>
			</view>
		</view>
		-->
		<view class="cu-list menu sm-border bg-white margin-top-sm"  >
			<view class="cu-item arrow" >
				<view class="content"  @tap="menuTap({ linkType:'router',linkName:'help'})">
					<text class="iconfont icon-zhaopinhui text-blue"></text>
					<text >求职</text>
				</view>
			</view>
			<view class="cu-item arrow" >
				<view class="content"  @tap="menuTap({ linkType:'router',linkName:'help'})">
					<text class="iconfont icon-zhaopin text-blue"></text>
					<text >招聘</text>
				</view>
			</view>
		</view>
		
	</view>
</template>

<script>
	import store from "@/store"
	export default {
		data() {
			return {
				userType:store.state.hh_userType
			}
		},
		methods: {
			menuTap(item){
				// 点击菜单
				if(item.linkType){
					if(item.linkType=='router'){
						if(item.linkName){
							let flag = false
							for(var num in ROUTES){
								const router = ROUTES[num]
								if(item.linkName == router.name){
									flag = true
									break
								}
							}
							if(flag){
								let params={}
								if(item.param1){//自定义参数1为请求参数，不为空时传入
									try{
										params = JSON.parse(item.param1)
									}catch(e){
										this.modelContent='请求参数（param1）配置必须是json格式'
										this.modelShow = true
										return
									}
								}
								this.$Router.push({ name:item.linkName,params:params})
							}else{
								this.modelContent='功能配置异常，未找到跳转页面'
								this.modelShow = true
							}
							
						}else{
							this.modelContent='功能目前在测试中，尚未开放'
							this.modelShow = true
						}
					}else if(item.linkType=='h5'){
						if(item.linkUrl){
							this.gotoOhterPage(item.linkUrl)
						}else{
							this.modelContent='功能目前在测试中，尚未开放'
							this.modelShow = true
						}
					}else{
						this.modelContent='功能目前在测试中，尚未开放'
						this.modelShow = true
					}
					
				}else{
					this.modelContent='功能目前在测试中，尚未开放'
					this.modelShow = true
				}
				
			},
			gotoOhterPage(url){
				console.log(url)
				if(url){
					// #ifdef H5
					window.open(url, '_blank');
					// #endif
					//微信公众号相关h5 需要去掉#wechat_redirect
					// #ifndef H5
					this.$Router.push({ name:'webView', params: { url:encodeURIComponent(url) }})
					// #endif
				}else{
					this.modelContent='没有传入跳转的链接'
					this.modelShow = true
				}
				
			},
		}
	}
</script>

<style>

</style>
